﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web; 
using System.Web.Services;
using BibliotecaClasse;
using System.Data;
//using System.Windows.Forms;

namespace WebService1
{
    /// <summary>
    /// Summary description for Service1
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class Service1 : System.Web.Services.WebService
    {
        DAOForm daoform = new DAOForm();

        [WebMethod]
        public void insertForm(Formulario f)
        {
            daoform.inserirFormulario(f);
        }

        [WebMethod]
        public void deleteForm(int cod)
        {
            daoform.deletarFormulario(cod);
        }
        
        [WebMethod]
        public void updateForm(Formulario f, int cod)
        {
            daoform.atualizarFormulario(f, cod);
        }
        
        [WebMethod]
        public DataTable listForm()
        {
            return daoform.getTodosRegistros();
        }
    }
}